<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>OM接口测试界面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="/test/static/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 20px;
        padding-bottom: 60px;
      }

      /* Custom container */
      .container {
        margin: 0 auto;
        max-width: 1000px;
      }
      .container > hr {
        margin: 60px 0;
      }

      /* Main marketing message and sign up button */
      .jumbotron {
        margin: 80px 0;
        text-align: center;
      }
      .jumbotron h1 {
        font-size: 100px;
        line-height: 1;
      }
      .jumbotron .lead {
        font-size: 24px;
        line-height: 1.25;
      }
      .jumbotron .btn {
        font-size: 21px;
        padding: 14px 24px;
      }

      /* Supporting marketing content */
      .marketing {
        margin: 60px 0;
      }
      .marketing p + h4 {
        margin-top: 28px;
      }


      /* Customize the navbar links to be fill the entire space of the .navbar */
      .navbar .navbar-inner {
        padding: 0;
      }
      .navbar .nav {
        margin: 0;
        display: table;
        width: 100%;
      }
      .navbar .nav li {
        display: table-cell;
        width: 1%;
        float: none;
      }
      .navbar .nav li a {
        font-weight: bold;
        text-align: center;
        border-left: 1px solid rgba(255,255,255,.75);
        border-right: 1px solid rgba(0,0,0,.1);
      }
      .navbar .nav li:first-child a {
        border-left: 0;
        border-radius: 3px 0 0 3px;
      }
      .navbar .nav li:last-child a {
        border-right: 0;
        border-radius: 0 3px 3px 0;
      }
    </style>
    <link href="/test/static/css/bootstrap-responsive.css" rel="stylesheet">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="/static/js/html5shiv.js"></script>
    <![endif]-->
  </head>
  <body>

    <div class="container">
        <div class="navbar">
          <div class="navbar-inner">
            <div class="container">
              <ul class="nav">
                <li class="active" attr="tab1"><a href="javascript:;" id="fire">查询接口</a></li>
                <li attr="tab2"><a href="javascript:;" id="control">控制接口</a></li>
                <li attr="tab3"><a href="javascript:;" id="dropped">挂断接口</a></li>
                <li attr="tab4"><a href="javascript:;" id="Hold">呼叫保持</a></li>
                <li attr="tab5"><a href="javascript:;" id="Omute">静音设置</a></li>
                <li attr="tab6"><a href="javascript:;" id="Monitor">监听模式</a></li>
                <li attr="tab7"><a href="javascript:;" id="Bargein">强插模式</a></li>
                <li attr="tab8"><a href="javascript:;" id="Transfer">呼叫转移</a></li>
                <li attr="tab9"><a href="javascript:;" id="Conference">三方通话</a></li>
                <li attr="tab10"><a href="javascript:;" id="Accept">来电处理</a></li>
              </ul>
            </div>
          </div>
        </div><!-- /.navbar -->
        <div class="row" id="tab-content">
            <div class="row-fluid span10" id="tab1">
                <form class="form-inline" id="form1" action="#" >
                    <button class="btn" id="btn-qdevice">查询设备</button>
                    <button class="btn" id="btn-qext">分机状态</button>
                    <button class="btn" id="btn-qdtrunk">中继状态</button>
                    <button class="btn" id="btn-qdvisitor">来电查询</button>
                    <button class="btn" id="btn-qouter">去电查询 </button>
                    <button class="btn" id="btn-qgroup">分机组</button>
                    <button class="btn" id="btn-qmenu">语音菜单</button>
                </form>
                <form class="form-inline" id="form2" action="#" style="display:none">
                    <button class="btn" id="btn-Dext">配置分机</button>
                    <button class="btn" id="btn-Dgroup">配置分机组</button>
                    <button class="btn" id="btn-Dmenu">配置语音菜单</button>
                </form>
                 <form class="form-inline" id="form3" action="#" style="display:none">
                    <button class="btn" id="btn-dropped">挂断分机</button>
                    <button class="btn" id="btn-Dcom">挂断来电</button>
                    <button class="btn" id="btn-Dout">挂断去电</button>
              
                </form>
                <form class="form-inline" id="form4" action="#" style="display:none">
                    <button class="btn" id="btn-Hold">呼叫保持</button>
                </form>
                <form class="form-inline" id="form5" action="#" style="display:none">
                    <button class="btn" id="btn-Mute">静音</button>
                    <button class="btn" id="btn-Unmute">解除静音</button>
                </form>
                <form class="form-inline" id="form6" action="#" style="display:none">
                    <button class="btn" id="btn-Monitor">监听</button>
                </form>
                <form class="form-inline" id="form7" action="#" style="display:none">
                    <button class="btn" id="btn-Bargein">强插</button>
                </form>
                <form class="form-inline" id="form8" action="#" style="display:none">
                    <button class="btn" id="btn-Transfer">呼叫转移</button>
                </form>
                <form class="form-inline" id="form9" action="#" style="display:none">
                    <button class="btn" id="btn-Conference">三方通话</button>
                </form>
                <form class="form-inline" id="form10" action="#" style="display:none">
                    <button class="btn" id="btn-Accept">挂断分机</button>
                </form>
                <div class="row" id="qdevice-res">
                    <pre>
                    </pre>
                </div>

                <br/>
                <form class="form-inline" name="form11" id="form11" action="" method="post">
                    <input type="text" name="ext" id="ext" class="input-small" placeholder="分机号">
                    <input type="text" name="phone" id="phone" class="input-small" placeholder="电话号码">
                   <!--  <button class="btn" name="call" id="call">拨打电话</button> -->
                    <input type="button"  name="call" id="call" class="btn" value="拨打电话" onclick="submitAdd('test.php')" >
                </form>
            </div>
        </div>
        <div class="footer">
            <p>&copy; Company 2013</p>
        </div>

    </div> <!-- /container -->
    <script src="/test/static/js/jquery.min.js"></script>
    <script src="/test/static/js/bootstrap.min.js"></script>
    <script src="/test/static/js/general.js"></script>
    <script type="text/javascript">
        //拨打电话
        function submitAdd(path){
          var text=$("#ext").val();
          var text2=$("#phone").val();
          var num = new RegExp("^[0-9]*$");
          var reg = new RegExp("/^(\d{3}-\d{8}|\d{4}-\d{7})$/");
          var phone = new RegExp("^0?(13|15|17|18|14)[0-9]{9}$");
          if(text=='')
          {
              alert('请输入分机号!');
              //window.history.go(-1);
              return false; 
          }
          else if(!num.test(text))
          {
              alert('请输入正确分机号!');
              return false; 
          }
          else if(text2=='')
          {
              alert('请输入要拨打的手机号码!');
              return false; 
          }
          else if(!reg.test(text2) && !phone.test(text2))
          {
             alert('信息输入有误，请核对后再拨!');
              return false; 
          }
          else
          {
            alert(1111);
             document.form11.attributes["action"].value = path;
             $('#form11').submit();
          }
          
        }
    </script>
  </body>
</html>